<<<<<<< HEAD
#include "mainwindow.h"

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}
=======
#include "functions.h"
#include <stdio.h>
#include <pthread.h> 
using namespace std;

string filename = "tasks.txt";

//定义锁变量
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;

//线程函数1

void *pthread_func1(void *args){
    vector<void *> *arg_list = (vector<void *> *)args;
    char **argv = (char **)(*arg_list)[0];
    string *filename = (string *)(*arg_list)[1];

    string command;
    if (strcpy(argv[1],"run")==0){
        while(1) {
            cout<<"请输入指令（add）："<<endl;
        
        }
    }
    
};

//线程函数2

void *pthread_func2(void *arg){
    while(1) {
        
    }
};

int main(int argc,char **argv)
{
    pthread_t thread_id1; 
    pthread_t thread_id2;
 /*1. 创建线程1*/
    vector<void *> args;
    args.push_back(argv);
    args.push_back(&filename);
    if(pthread_create(&thread_id1,NULL,pthread_func1,&args)) { 
        printf("线程1创建失败!\n");
        return -1;
    }

/*2. 创建线程2*/

    if(pthread_create(&thread_id2,NULL,pthread_func2,NULL)) { 
        printf("线程2创建失败!\n");
        return -1; 
    }

/*3. 等待线程结束,释放线程的资源*/

    pthread_join(thread_id1,NULL); pthread_join(thread_id2,NULL);
    return 0;

}
>>>>>>> fc25350d42a2f4fb928ad55076097ca0dad100eb
